﻿
function InputCheck() {
    var result = "";
    $(".entity-notnull-check").each(function(index) {
        var inputfield = $(this).children().first();
        if (inputfield.val() == "") {
            result += $(this).prev().text() + " could not be empty!\n";
            inputfield.addClass("validation-error");
        }
        else {
            inputfield.removeClass("validation-error");
        }
    });

    if (result != "") {
        alert(result);
        event.returnValue = false;
        return false;
    }
    else {
        return true;
    }
}

$(function() {
    $(".customer-ok").each(function(index) {
        $(this).bind("click", function() {
            InputCheck();
        });
    });
});





